from django.db import models

# Create your models here.
class UserInfo(models.Model):
    name = models.CharField(max_length=32)
    password = models.CharField(max_length=64)
    age = models.IntegerField(default=2)

    gender = models.CharField(max_length=16, default="男")
    salary = models.IntegerField()
"""
create table appo1_userinfo(
    id bigint auto_increment primary key,
    name varchar(32),
    password varchar(32),
    age int
"""

# 新建数据
# 本质：insert into app01_department(title) values("销售部")
# Department.objects.create(title="销售部")

# <i class="fa fa-trash-o" aria-hidden="true"></i>
# UserInfo.objects.filter(id=1).delete()
# UserInfo.objects.all().delete()

# 获取数据
# data_list = UserInfo.objects.filter(id=1)
# data_list = UserInfo.objects.all()

# 更新数据
# UserInfo.objects.all().update(password=0000)
# UserInfo.objects.filter(id=1).update(password=0000)